package com.ww.scm.entity.mat;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.ww.scm.entity.AbstractEntity;
import com.ww.scm.entity.pub.Dictionary;

@Entity
@Table(name = "T_FINANCE_ACCOUNT")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
// 业务单据
public class FinanceAccount extends AbstractEntity {

	// 所属门店
	private Dictionary dian; 
	//资金形式
	private Dictionary financeForms;
	//余款
	private Double money=0.0;
	public FinanceAccount() {
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
	@JoinColumn(name = "F_DIAN")
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) 
	public Dictionary getDian() {
		return dian;
	}
	
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
	@JoinColumn(name = "F_FINANCE_FORMS")
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) 
	public Dictionary getFinanceForms() {
		return financeForms;
	}
	

	@Column(name = "F_MONEY",  precision = 12, scale = 4)
	public Double getMoney() {
		return money;
	}

	public void setDian(Dictionary dian) {
		this.dian = dian;
	}
	
	public void setFinanceForms(Dictionary financeForms) {
		this.financeForms = financeForms;
	}

	public void setMoney(Double money) {
		this.money = money;
	} 

}
